package com.imooc.jms.consumer;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * Created by spoplar on 17-7-27.
 */
public class ConsumerMessageListener implements MessageListener {
    public void onMessage(Message message) {
        TextMessage textMessage = (TextMessage) message;

        String text ="";
        try {
           text =  textMessage.getText();
        } catch (JMSException e) {
            e.printStackTrace();
        }
        System.out.println(text);
    }
}
